<script setup lang="ts">
import { getCurrentInstance, computed } from "vue";
import type Typings from "@/typings";
import useMenuStore from "@/pinia/menu";
import useSystemStore from "@/pinia/system";
const menuStore = useMenuStore();
const systemStore = useSystemStore();

// vue 实例
const curIns = getCurrentInstance()?.proxy;

// 菜单是否收缩
const isCollapse = computed(() => systemStore.isCollapse);

const menuList = computed<Typings.XtPublic.Menu.item[]>(
  () => menuStore.menuList
);
</script>

<template>
  <xt-scrollbar class="h-full" height="100%" :view-style="{ height: '100%' }">
    <xt-menu
      class="h-full w-[200px] select-none"
      router
      unique-opened
      :default-active="curIns?.$route.path"
      :collapse="isCollapse"
      :menuList="menuList"
    />
  </xt-scrollbar>
</template>
